<!doctype html>
<html>
<head>
	<link rel="stylesheet" href="../../codebase/webix.css" type="text/css" media="screen" charset="utf-8">
	<script src="../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>
	<title>GoogleMap::Draggable Markers</title>
</head>
<body>
	<div id="sample_div" style='width:600px; height:300px; margin:50px;'></div>
	
	<script type="text/javascript">

		webix.ui({
			container:"sample_div",
			//provide your own Google API key
			key:"AIzaSyAi0oVNVO-e603aUY8SILdD4v9bVBkmiTg",
    		view:"google-map",
    		id:"map",
			zoom:6,
			center:[ 48.724, 8.215 ],
			data:[
				{ id:1, lat:48.782, lng:9.177, label:"A", draggable:true },
				{ id:2, lat:47.366, lng:8.55, label:"B", draggable:true },
				{ id:3, lat: 48.137, lng: 11.575, label:"C", draggable:true }
			]
		});


		
		$$("map").attachEvent("onAfterDrop", function(id, item){
			var title = this.getItem(id).label;
			webix.message(title+" moved:<br>lat "+item.lat+",<br>lng "+item.lng);
		});
		

	</script>
</body>
</html>